package com.xu.mall.framework.test;

import org.junit.After;
import org.junit.Before;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BaseTestCase {
	public static ApplicationContext appContext;

	@Before
	public void init() {
		try {
			if (appContext == null) {
				String[] locations = { "applicationContext.xml", "applicationContext-*.xml" };

				appContext = new ClassPathXmlApplicationContext(locations);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println("配置文件加载结束。。。。。");
	}

	@After
	public void runAfterTest() {
		appContext = null;
		System.out.println("测试结束。。。。。");
	}
}
